# Project: kernel
# Makefile created by Dev-C++ 5.11

CPP      = g++.exe
CC       = gcc.exe
LD		 = ld.exe
WINDRES  = windres.exe
OBJ      = ./../build/kernel/page.o ./../build/kernel/vma.o ./../build/kernel/chunk.o ./../build/kernel/irq.o ./../build/kernel/time.o ./../build/kernel/slab.o ./../build/kernel/heap.o ./../build/kernel/proc.o ./../build/kernel/semaphore.o
LINKOBJ  = ./../build/kernel/page.o ./../build/kernel/vma.o ./../build/kernel/chunk.o ./../build/kernel/irq.o ./../build/kernel/time.o ./../build/kernel/slab.o ./../build/kernel/heap.o ./../build/kernel/proc.o ./../build/kernel/semaphore.o
LIBS     = -static-libgcc -m32
INCS     = -I"./../include" -I"./../include/kernel" -I"./../include/std"
CXXINCS  = -I"./../include" -I"./../include/kernel" -I"./../include/std"
BIN      = ../build/kernel/kernel.o
CXXFLAGS = $(CXXINCS) -m32 -O3 -pipe
CFLAGS   = $(INCS) -m32 -O3 -pipe
RM       = rm.exe -f

.PHONY: all all-before all-after clean clean-custom

all: all-before $(BIN) all-after

clean: clean-custom
	${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
	$(LD) -r $(LINKOBJ) -o $(BIN)

./../build/kernel/page.o: page.c
	$(CC) -c page.c -o ./../build/kernel/page.o $(CFLAGS)

./../build/kernel/vma.o: vma.c
	$(CC) -c vma.c -o ./../build/kernel/vma.o $(CFLAGS)

./../build/kernel/chunk.o: chunk.c
	$(CC) -c chunk.c -o ./../build/kernel/chunk.o $(CFLAGS)

./../build/kernel/irq.o: irq.c
	$(CC) -c irq.c -o ./../build/kernel/irq.o $(CFLAGS)

./../build/kernel/time.o: time.c
	$(CC) -c time.c -o ./../build/kernel/time.o $(CFLAGS)

./../build/kernel/slab.o: slab.c
	$(CC) -c slab.c -o ./../build/kernel/slab.o $(CFLAGS)

./../build/kernel/heap.o: heap.c
	$(CC) -c heap.c -o ./../build/kernel/heap.o $(CFLAGS)

./../build/kernel/proc.o: proc.c
	$(CC) -c proc.c -o ./../build/kernel/proc.o $(CFLAGS)

./../build/kernel/semaphore.o: semaphore.c
	$(CC) -c semaphore.c -o ./../build/kernel/semaphore.o $(CFLAGS)
